/*
 * @Author: wangming
 * @Date: 2020-09-03 16:33:37
 * @LastEditors: wangming
 * @LastEditTime: 2020-11-05 14:19:55
 * @Description: file content
 */
import { InputNumber } from "element-ui";
export default {
  components: { InputNumber },
  props: ["value"],
  methods: {
    def() {
      this.datas = this.value;
    },
  },
  data() {
    return {
      datas: "",
    };
  },
  watch: {
    value: {
      handler: "def",
      immediate: true,
    },
    datas(v) {
      this.$emit("input", v || 0);
    },
  },
  render(h) {
    return h("InputNumber", {
      on: {
        ...this.$listeners,
      },
      model: {
        value: this.datas,
        callback: (v) => {
          this.datas = v;
        },
        expression: "datas",
      },
      attrs: {
        ...this.$attrs,
      },
    });
  },
};
